package com.onluy.mqcomsumer;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageListener;


public class LogListener   implements MessageListener
{
	protected Logger log =   LoggerFactory.getLogger(this.getClass());


	public void onMessage(Message msg) {
		try { byte[] bytes = msg.getBody();
			String data = new String(bytes, "UTF-8");
			if ((data != null) && (!"".equals(data))) {
				log.info("mq收到数据:" + data);
				//OrderCallbackMQInfo orderCallbackMQInfo = (OrderCallbackMQInfo)JSON.parseObject(data, OrderCallbackMQInfo.class);
				//this.orderCallbackMQInfoDispatchService.callbackDispatch(orderCallbackMQInfo);
			}
		} catch (Exception e) {
			log.error("mq获取数据异常:" + e.getMessage(), e);
		}
	}
}